<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%   String path = request.getContextPath();   
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
	String bpath = request.getScheme()+"://"+request.getServerName();
%>
<!DOCTYPE html>
<html lang="en">
 <head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0,,user-scalable=no">
 <meta name="description" content="">
 <meta name="author" content="">
 <link rel="icon" href="http://v3.bootcss.com/favicon.ico">
<title>新增相册</title>
 <link href="/bootstrapDemo/bootstrap/css/bootstrap.css" rel="stylesheet">
 <link href="/bootstrapDemo/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
 <script src="/bootstrapDemo/js/jquery.js"></script>
<script src="/bootstrapDemo/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript">
	function toSubmitPg(){
		 var reg = /^\d+$/;
		var GName = document.getElementById("GName").value;
		var GDescribe = document.getElementById("GDescribe").value;
		var GOrder = document.getElementById("GOrder").value;
		if(GName==null || GName=="" || GName=="undefined"){
			alert("请输入相册名称！");
			return;
		}else if(GDescribe==null || GDescribe=="" || GDescribe=="undefined"){
			alert("请输入相册描述！");
			return;
		}else if(GOrder==null || GOrder=="" || GOrder=="undefined"){
			alert("请输入相册序号！");
			return;
		}else if(!GOrder.match(reg)){
			alert("相册序号为数字");
		}else{
			document.getElementById("photogadd").submit();
		}
	}
</script>
</head>
<body>
<ol class="breadcrumb">
  <li><a href="#">相册管理</a></li>
  <li class="active">相册增加</li>
</ol>
<center>
	<div class="panel-body" style="width: 95%;">
	<form id="photogadd"  name = "photogadd" action="/photo/savePhotoGroup.action" method="post">
	  <table class="table">
	 	 <tr style="background-color: white;border: 0">
				<td width="10%">相册名称</td>		
				<td >
				<input type="text" name="photog.GName"  class="form-control" id="GName" placeholder="请填写相册名称">
				</td>		
		</tr>
		<tr style="background-color: white;border: 0">
			<td >相册描述</td>		
			<td >
			<input type="text" name="photog.GDescribe"  class="form-control" id="GDescribe" placeholder="请填写相册描述">
			</td>		
		</tr>
		<tr style="background-color: white;border: 0">
			<td >相册序号</td>		
			<td >
				<input type="number" name="photog.GOrder"  class="form-control" id="GOrder" >
			</td>		
		</tr>
	  </table>
	  <button type="button" class="btn btn-primary" onclick="toSubmitPg();" >提交</button>
	  <button  type="button" class="btn btn-primary"  onclick="resetForm();">重置</button>
	  </form>
	</div>
</center>

</body>
</html>